<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('购货入库列表')"/>
    <th:block th:include="include :: datetimepicker-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>购货单号：</label>
                            <input type="text" name="gouhuoDanhao"/>
                        </li>
                        <li>
                            <label>购货日期：</label>
                            <input type="text" class="time-input" placeholder="请选择购货日期" name="chukuDate"/>
                        </li>
                        <li>
                            <label>商品名称：</label>
                            <input type="text" name="shangpinName"/>
                        </li>
                        <li>
                            <label>商品类别：</label>
                            <select name="shangpinLeibie"  class="form-control">
                                <option value="">所有</option>
                                <option value="整套门">整套门</option>
                                <option value="双开门左扇">双开门左扇</option>
                                <option value="双开门右扇">双开门右扇</option>
                                <option value="门扇">门扇</option>
                                <option value="门框">门框</option>
                                <option value="五金（防火锁）">五金（防火锁）</option>
                                <option value="五金（闭门器）">五金（闭门器）</option>
                                <option value="五金（拉爆盖）">五金（拉爆盖）</option>
                            </select>
                        </li>
                        <li>
                            <label>规格宽：</label>
                            <input type="text" name="guiGeKuan"/>
                        </li>
                        <li>
                            <label>规格高：</label>
                            <input type="text" name="guiGeGao"/>
                        </li>
                        <li>
                            <label>开向：</label>
                            <input type="text" name="kaiXiang"/>
                        </li>
                        <li>
                            <label>商品单价：</label>
                            <input type="text" name="danJia"/>
                        </li>
                        <li>
                            <label>备注：</label>
                            <input type="text" name="beizhu"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div hidden id="session2value" th:text="${session.QuanXian}"></div>
        <div class="btn-group-sm" id="toolbar" role="group">
<!--            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="gouhuoruku:rukuTest:add">
                <i class="fa fa-plus"></i> 添加
            </a>-->
            <a th:unless="${session.QuanXian eq '6'}" class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="gouhuoruku:rukuTest:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a th:unless="${session.QuanXian eq '6'}" class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="gouhuoruku:rukuTest:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
<!--            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="gouhuoruku:rukuTest:export">-->
<!--                <i class="fa fa-download"></i> 导出-->
<!--            </a>-->
<!--                        <a class="btn btn-success" onclick="$.operate.addMoreTab()" shiro:hasPermission="piliangruku:rukuTest:view">-->
<!--                                <i class="fa fa-plus"></i> 批量添加-->
<!--                            </a>-->
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>

</div>
<!--     <script>-->
<!--         if ($.session.get('QuanXian') !== 1){-->
<!--             var zongdi = $('table[id="bootstrap-table"]').children('tbody').children('tr').children[11]-->
<!--             zongdi.empty()-->
<!--         }-->
<!--     </script>-->
<th:block th:include="include :: footer"/>

<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('gouhuoruku:rukuTest:edit')}]];
    var removeFlag = [[${@permission.hasPermi('gouhuoruku:rukuTest:remove')}]];
    var cangkuNameDatas = [[${@dict.getType('sys_job_group')}]];
    var prefix = ctx + "gouhuoruku/rukuTest";


    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "购货入库",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '编号',
                    visible: false
                },
                {
                    field: 'gouhuoDanhao',
                    title: '购货单号'
                },
                {
                    field: 'chukuDate',
                    title: '购货日期'
                },
                {
                    field: 'shangpinName',
                    title: '商品名称'
                },
                {
                    field: 'rukuMen',
                    title: '入库操作人'
                },
                {
                    field: 'tupian',
                    title: '商品图片',
                    formatter: function(value, row, index) {
                        const actions = [];
                        actions.push('<img src="'+value+'" style="width: 150px;height: 150px;object-fit: contain">');
                        return actions.join('');
                    }                        },
                {
                    field: 'shangpinLeibie',
                    title: '商品类别'
                },
                {
                    field: 'guiGeKuan',
                    title: '规格宽'
                },
                {
                    field: 'guiGeGao',
                    title: '规格高'
                },
                {
                    field: 'kaiXiang',
                    title: '开向'
                },
                {
                    field: 'shuLiang',
                    title: '商品数量'
                },
                {
                    field: 'danJia',
                    title: '商品单价'
                },
                {
                    field: 'zongjine',
                    title: '总金额'
                },
                {
                    field: 'beizhu',
                    title: '备注'
                }
                /*{
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }*/
            ]
        };
        $.table.init(options);
    })


</script>
</body>
</html>